//
//  ACEQuestionAnswerTableSectionHeaderView.m
//  ACE
//
//  Created by zhangtao on 2018/8/13.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "ACEQuestionAnswerTableSectionHeaderView.h"

@implementation ACEQuestionAnswerTableSectionHeaderView
{
    UILabel *subjectLab;
    UILabel *secondLab;
    UILabel *numLab;
}
-(instancetype)initWithFrame:(CGRect)frame andTotalNum:(NSInteger)totalNum{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = RGB(244, 244, 244, 1);
        subjectLab = [[UILabel alloc]initWithFrame:CGRectMake(15, 0, 200, frame.size.height)];
        subjectLab.text = @"题目";
        [self addSubview:subjectLab];
        
        numLab = [[UILabel alloc]initWithFrame:CGRectZero];
        [self addSubview:numLab];
        numLab.font = [UIFont systemFontOfSize:17];
        numLab.textColor = [UIColor darkGrayColor];
        numLab.text = [NSString stringWithFormat:@"/%ld",totalNum];
        [numLab sizeToFit];
        numLab.frame = CGRectMake(frame.size.width-numLab.frame.size.width-15, 0, numLab.frame.size.width, frame.size.height);
        
        secondLab = [[UILabel alloc]initWithFrame:CGRectMake(frame.size.width-100, 0, 100-CGRectGetWidth(numLab.frame)-15, frame.size.height)];
        secondLab.textColor = RGB(251, 176, 68, 1);
        secondLab.textAlignment = NSTextAlignmentRight;
        secondLab.font = [UIFont systemFontOfSize:20];
        [self addSubview:secondLab];
        
       
    }
    return self;
}

-(void)setSecond:(NSString *)second{
      secondLab.text = [NSString stringWithFormat:@"%@",second];
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
